#ifndef _CMD_ANALYSE_H
#define _CMD_ANALYSE_H

#include "my_sys.h"

#define CMD_LENGTH_MAX     15
#define CMD_ID_LENGTH      4
#define CMD_NUM_MAX        10

#define CMD_HEAD    '#'   //命令头标识
#define CMD_TAIL     '!'  //命令尾标识

/// @brief 数据解析结构体
typedef struct 
{
    uint8_t Re_FinishFlag;
    uint8_t Re_StartFlag;
    char Buffer[CMD_LENGTH_MAX];
    uint8_t BufferIndex;
}ReBuf_Type;


/// @brief 命令结构体
typedef struct 
{
    char* CmdId; //4个字符+一个'\n'
    char* Description;    //命令描述
    void (*CmdFun)(int16_t CtrlValue); //对应命令执行函数
}Cmd_Tpye;




void CmdGetChar(char Info);
void CmdInit(void);
void CmdRegister(char* _CmdId, char* Description, void (*Funcation)(int16_t CtrlValue));
void CmdLoop(uint16_t Cycle);

// void CmdTest(void);

#endif



